import "package:flutter/material.dart";

// ignore: must_be_immutable
class Tag extends StatelessWidget {
  String text;
  bool plain;
  Tag(
    this.text, {
    super.key,
    this.plain = false,
  });
  @override
  Widget build(BuildContext context) {
    BoxDecoration decoration;
    if (plain) {
      decoration = BoxDecoration(
        borderRadius: BorderRadius.circular(2),
        border: Border.all(
          width: 0.5,
          color: const Color.fromARGB(255, 255, 77, 0),
        ),
      );
    } else {
      decoration = BoxDecoration(
        borderRadius: BorderRadius.circular(2),
        color: const Color.fromARGB(255, 255, 235, 224),
      );
    }
    return Container(
      margin: const EdgeInsets.only(right: 8),
      padding: const EdgeInsets.only(left: 3, right: 3),
      decoration: decoration,
      child: Text(
        text,
        overflow: TextOverflow.ellipsis,
        maxLines: 1,
        style: const TextStyle(
          color: Color.fromARGB(255, 255, 77, 0),
          fontSize: 11,
        ),
      ),
    );
  }
}
